import java.util.Random;
import java.util.Scanner;

public class demo1 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        Random random=new Random();
        int toguess= random.nextInt(100);
        System.out.println("输入要猜的数字");
        while(true){
            int guess= input.nextInt();
            if(guess>toguess){
                System.out.println("猜大了");
            }
            else if(guess<toguess){
                System.out.println("猜小了");
            }
            else{
                System.out.println("猜对了");
                return;
            }
        }
    }
}
